#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

constexpr int mod = 1e9 + 7;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, k;
  string str;
  cin >> n >> k >> str;
  vector<vector<array<i64, 5>>> dp(n, vector<array<i64, 5>>(n));
  for (int l = n - 1; l >= 0; l --) {
    for (int r = l; r < n; r ++) {
      auto &res = dp[l][r];
      fill(res.begin(), res.end(), 0);
      if (r - l + 1 <= k && all_of(str.begin() + l, str.begin() + r + 1, [](char c) { return c == '*' || c == '?'; })) {
        // S
        res[0] = 1;
      }
      if (l != r && (str[l] == '(' || str[l] == '?') && (str[r] == ')' || str[r] == '?')) {
        if (l + 1 == r) {
          // ()
          res[1] = res[4] = 1;
        } else {
          for (int st = 0; st < 4; st ++) {
            // (A) (AS) (SA) (S)
            res[1] = (res[1] + dp[l + 1][r - 1][st]) % mod;
            res[4] = (res[4] + dp[l + 1][r - 1][st]) % mod;
          }
        }
      }
      for (int k = l; k < r; k ++) {
        // A = A' + A
        res[1] = (res[1] + dp[l][k][4] * dp[k + 1][r][1]) % mod;
        // A = A' + SA
        res[1] = (res[1] + dp[l][k][4] * dp[k + 1][r][3]) % mod;
        // AS = A + S
        res[2] = (res[2] + dp[l][k][1] * dp[k + 1][r][0]) % mod;
        // SA = S + A
        res[3] = (res[3] + dp[l][k][0] * dp[k + 1][r][1]) % mod;
      }
    }
  }
  cout << dp[0][n - 1][1] << '\n';
}